import java.io.IOException;
import java.util.ArrayList;


public class Ex1_6 {
	public static void main(String[] args) {
		ArrayList li = new ArrayList();
		try {
			String pattern = "ATACGTACCC";
			String genome =   KmerCounter.readFile("C:\\Users\\josemfer\\Downloads\\dataset_8_3.txt").trim();		
			int d = 5;
			for (int i=0;i<genome.length()-pattern.length()+1;i++) {
				if (Ex1_6.difference(
						pattern, genome.substring(i,i+ pattern.length())) <= d) {
					//System.out.print(i + " ");
					li.add(i);
				}
			}
			
			System.out.println(li);
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			
			e.printStackTrace();
		}	
	}
	
	public static int difference(String pattern, String seq) {
		int d = 0;
		if (pattern.length() != seq.length()) {
			return -1;
		}
		for (int i=0;i<pattern.length();i++) {
				if (pattern.charAt(i) != seq.charAt(i)) {
					d++;
				}
		}
		return d;
	}
}
